#include "CAnimation.h"

CAnimation::CAnimation(void)
{
	currentFrame = 0;
	animationSpeed = 1.0f;
	scale = 1.0f;
	frameTime = 0.0f;
}

CAnimation::~CAnimation(void)
{
	for(unsigned int i = 0; i < frames.size(); i++)
	{
		delete frames[i];
	}
	frames.clear();
}

void CAnimation::SetCurrentFrame(int frame)
{
	if(frame < 0)
		return;
	if(frame > (int)frames.size() - 1)
		currentFrame = 0;
	else
		currentFrame = frame;
}

void CAnimation::PushFrame(CFrame* frame)
{
	frames.push_back(frame);
}
